import { NgModule, OnInit } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RouterModule } from '@angular/router';

import { AdminPageComponent } from './admin-page/admin-page.component';
import { EditPageComponent } from './edit-page/edit-page.component';
import { FormsModule } from '@angular/forms';
// import { FormatPipe } from '../../pipes/home.pipe';
import { PipesModule } from '../../pipes/pipes.module';
import { DataTableModule } from 'primeng/primeng';
import { ButtonModule } from 'primeng/primeng';
import { CheckboxModule } from 'primeng/primeng';
import { RadioButtonModule } from 'primeng/primeng';
import { HttpClientModule } from '@angular/common/http';

@NgModule({
  declarations:   [
    AdminPageComponent,
    EditPageComponent
  ],
  imports: [
    // Import Official Shared Module
    CommonModule,
    // Config Router
    RouterModule.forChild([
      { path: '', component: AdminPageComponent, pathMatch: 'full' },
      { path: 'newUser', component: EditPageComponent, pathMatch: 'full'},
      { path: 'edit/:id', component: EditPageComponent, pathMatch: 'full'}
    ]),
    FormsModule,
    PipesModule,
    DataTableModule,
    ButtonModule,
    CheckboxModule,
    RadioButtonModule,
    HttpClientModule
  ],
  providers:[ ]
})
export class AdminModule { }
